package com.example.controller;

import com.example.entity.User;
import com.example.service.UserService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * com.example.controller.UserController
 *
 * @author ZRS
 * @version V1.0
 * @since 2025/10/30 20:16
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @Resource
    UserService userService;


    @GetMapping("/all")
    public List<User> all() {
        List<User> users = userService.findAll();
        return users;
    }

}
